package cn.yangliu.nacos.comm.config.security;


import java.util.ArrayList;
import java.util.List;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * The interface Security properties.
 *
 * @author 问道于盲
 */
@Data
@ConfigurationProperties(prefix = "security")
public class SecurityProperties {

    /**
     * current class instance's member.
     * The Admins.
     */
    private List<String> admins = new ArrayList<>();

    /**
     * 默认放行url
     */
    public static final String DEFAULT_IGNORE_URL = "/actuator/**,/swagger-ui.html,/swagger-resources/**," +
			"/images/**," +
			"/webjars/**,/v2/api-docs,/configuration/ui,/configuration/security,/registe,/static/**,/favicon.ico," +
			"/login,/doc.html,/,/index.html,/js/**/,/css/**,/img/**,/fonts/**";
    /**
     * 登录url
     */
    private String loginUrl = "/login";


    /**
     * 个人信息接口
     */
    private String principalUrl = "/principal";

    /**
     * security 放行接口
     */
    private String ignoreUrl = "";


    /**
     * 同一账号同时登陆最大限制数
     */
    private int maximumSessions = 1;

    /**
     * 同一账号超过最大同时登陆次数后,是否阻止后续登陆
     */
    private boolean maxSessionsPreventsLogin = false;


}
